package com.study.common.web.enums;

import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.ToString;

/**
 * @author Huhailong
 * @Description 返回状态
 * @Date 2021/3/26.
 */
@ToString
@AllArgsConstructor
public enum RespCodeEnum {

    //201-请求成功并且创建了新的自愿
    SUCCESS (20000),
    //416-为满足请求条件会返回此状态码
    BAD_REQ(40016),
    //500-系统错误
    ERROR_SYS(50000),
    //401-未授权
    NOT_AUTHORIZE(40001),
    //403-服务器拒绝访问
    NOT_AUTHENTIC(40003),
    ;

    private final int code;

    @JsonValue
    public int getCode() {
        return code;
    }
}
